﻿<ResourceDictionary xmlns:Controls="clr-namespace:MadMediaManager.Views.Shell.Controls" 
                    xmlns:Formatters="clr-namespace:MadMediaManager.Views.Converters"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"                    
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    >

    <SolidColorBrush Color="#FF282A33" x:Key="BrushBackgroundDark" />
    <SolidColorBrush Color="Black" x:Key="BrushBlack" />
    <SolidColorBrush Color="White" x:Key="BrushWhite" />
    <SolidColorBrush Color="WhiteSmoke" x:Key="BrushWhiteSmoke" />
    <SolidColorBrush Color="#FF697371" x:Key="BrushBackgroundMedium" />
    <SolidColorBrush Color="#FFFFE7A6" x:Key="BrushABCLight" />
    <SolidColorBrush Color="#FFF5BA52" x:Key="BrushABCMedium" />
    <SolidColorBrush Color="#FFFF8000" x:Key="BrushABCDark" />

    <Style TargetType="{x:Type Controls:MainMenuButton}">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:MainMenuButton}">
                    <ControlTemplate.Resources>
                        <Formatters:FormattingConverter x:Key="formattingConverter" />
                        <Storyboard x:Key="OnMouseEnter1">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="NavigationButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.2"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="NavigationButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.2"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="OnMouseLeave1">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="NavigationButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="NavigationButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <StackPanel x:Name="NavigationButton" RenderTransformOrigin="0.5,0.5">
                        <StackPanel.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="1"/>
                            </TransformGroup>
                        </StackPanel.RenderTransform>
                        <Grid Margin="0,0,0,-5" HorizontalAlignment="Right">
                            <Ellipse x:Name="elp" Width="20" Height="20" Fill="Gray" Stroke="Black" StrokeThickness="1" />
                            <TextBlock x:Name="tb" Foreground="White" Text="{TemplateBinding ActiveRecordCount, Converter={StaticResource formattingConverter}, ConverterParameter=\{0:F0\}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Grid>
                        <Image Margin="4" Source="{TemplateBinding Image}" Height="48" Width="48" Stretch="Uniform" />
                        <TextBlock Text="{TemplateBinding Title}" HorizontalAlignment="Center" />
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="NavigationButton">
                            <BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="NavigationButton">
                            <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
                        </EventTrigger>
                        <Trigger Property="ActiveRecordCount" Value="0">
                            <Setter TargetName="elp" Property="Visibility" Value="Hidden" />
                            <Setter TargetName="tb" Property="Visibility" Value="Hidden" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>